import { dosql } from "../tool/sqlTool";
import { blog_User } from "../tool/varType";

// 读取数据库账号的信息
export async function readblogUser(email: string) {
  return dosql(`select email from bloguser where email="${email}"`, []);
}
// 保存用户注册的数据
export async function saveblogUser(blog_User: blog_User) {
  return dosql(`insert into bloguser (email,password) values (?,?)`, [
    blog_User.email,
    blog_User.password,
  ]);
}
// loginblogUser
export async function readLoiginData(blog_User: blog_User) {
  return dosql(`select * from bloguser where email=? and password=? `, [
    blog_User.email,
    blog_User.password,
  ]);
}
